<template>
	<view class="goods-list">
     <view class="goods-item">
       <view class="left">
         <image :src="goods.goods_small_logo || defaultPic" mode=""></image>
       </view>
       <view class="right">
         <text>{{goods.goods_name}}</text>
         <text class="goods-price">￥{{goods.goods_price | toFixed}}</text>
       </view>
     </view>
	</view>
</template>

<script>
	export default {
    props:{
      goods:{
        type:Object,
        required:true
      }
    },
    filters:{
      toFixed(x){
        return Number(x).toFixed(2)
      }
    },
		data() {
			return {
				defaultPic: 'https://img3.doubanio.com/f/movie/8dd0c794499fe925ae2ae89ee30cd225750457b4/pics/movie/celebrity-default-medium.png'
			};
		}
	}
</script>

<style lang="scss">
.goods-item {
  display: flex;
  padding: 0 5px;
  margin-bottom: 10px;
  border-bottom: 1px solid #efefef;
  .left {
    image {
      width: 100px;
      height: 100px;
      margin-right: 5px;
    }
  }
  .right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 16px;
    .goods-price {
      color: #c00000;
    }
  }
}
</style>
